package com.persondemo.videoappliction.ui.adapter;

import android.support.annotation.Nullable;
import android.widget.Button;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.persondemo.videoappliction.R;
import com.persondemo.videoappliction.bean.DianPingChoiceBean;

import java.util.List;

public class DianpingPriceAdapter extends BaseQuickAdapter<DianPingChoiceBean.DataBean.ShaixuanBean, BaseViewHolder> {
    public DianpingPriceAdapter(@Nullable List<DianPingChoiceBean.DataBean.ShaixuanBean> data) {
        super(R.layout.item_dianping_03_01, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, DianPingChoiceBean.DataBean.ShaixuanBean item) {
        Button button = helper.getView(R.id.dianping03_item_btn);
        if (item.ischeck() == true) {
            button.setBackgroundResource(R.drawable.item_a);
        } else {
            button.setBackgroundResource(R.drawable.item_c);
        }
        helper.setText(R.id.dianping03_item_btn, item.getXname());
        helper.addOnClickListener(R.id.dianping03_item_btn);
    }
}
